import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '标题',
    align: "center",
    dataIndex: 'title'
  },
  {
    title: '新闻分类',
    align: "center",
    dataIndex: 'newsType_dictText'
  },
  {
    title: '作者',
    align: "center",
    dataIndex: 'author'
  },
  {
    title: '来源',
    align: "center",
    dataIndex: 'docSource'
  },
  {
    title: '置顶',
    align: "center",
    dataIndex: 'upFlag',
    customRender:({text}) => {
       return  render.renderSwitch(text, [{text:'是',value:'Y'},{text:'否',value:'N'}]);
     },
  },
  {
    title: '评论标志',
    align: "center",
    dataIndex: 'talkFlag',
    customRender:({text}) => {
       return  render.renderSwitch(text, [{text:'是',value:'Y'},{text:'否',value:'N'}]);
     },
  },
  {
    title: '排序',
    align: "center",
    dataIndex: 'sortIndex'
  },
  {
    title: '点击次数',
    align: "center",
    dataIndex: 'clickCount'
  },
  {
    title: '是否启用',
    align: "center",
    dataIndex: 'isEnabled',
    customRender:({text}) => {
       return  render.renderSwitch(text, [{text:'是',value:'Y'},{text:'否',value:'N'}]);
     },
  },
];

// 高级查询数据
export const superQuerySchema = {
  title: {title: '标题',order: 0,view: 'text', type: 'string',},
  newsType: {title: '新闻分类',order: 2,view: 'text', type: 'string',},
  author: {title: '作者',order: 3,view: 'text', type: 'string',},
  docSource: {title: '来源',order: 4,view: 'text', type: 'string',},
  upFlag: {title: '置顶',order: 7,view: 'switch', type: 'string',},
  talkFlag: {title: '评论标志',order: 8,view: 'switch', type: 'string',},
  sortIndex: {title: '排序',order: 9,view: 'number', type: 'number',},
  clickCount: {title: '点击次数',order: 10,view: 'number', type: 'number',},
  isEnabled: {title: '是否启用',order: 12,view: 'switch', type: 'string',},
};
